import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Display;

public class PlayMenu extends Canvas{
	private MainMenu mainmenu;
	private Display display;
	private byte yselect, menuselect;
	private FishingPlace fishingplace;
	public PlayMenu(MainMenu mainmenu, Display display){
		this.mainmenu = mainmenu;
		this.display = display;
		yselect = 25;
		menuselect = 1;
		fishingplace = new FishingPlace(this, display);
		setFullScreenMode(true);
	}
	public void paint(Graphics g){
		g.setColor(255, 255, 255);
		g.fillRect(0, 0, 128, 160);		
		g.setColor(50,130,255);
		g.fillRect(0, yselect - 2, 128, 15);
		g.setColor(0, 0, 0);
		//g.drawLine(64,0,64,160);
		if(Option.language == true){			
			g.drawString("Di Cau", 48,25,0);
			g.drawString("Tui Do", 47,40,0);
			g.drawString("Cua Hang", 40,55,0);
			g.drawString("Dat Hang Tren Mang", 15,70,0);
			g.drawString("Tinh Trang", 35,85,0);
			g.drawString("Danh Sach Ca", 30,100,0);
			g.drawString("Tro ve", 95, 145, 0);
		}
		else{			
			g.drawString("Go Fishsing", 37,25,0);
			g.drawString("Pack", 53,40,0);
			g.drawString("Shop",52,55,0);
			g.drawString("Online Shop",36,70,0);
			g.drawString("Status", 47,85,0);
			g.drawString("Fish List", 44,100,0);
			g.drawString("Back", 103, 145, 0);
		}
	}
	protected void keyPressed(int keycode){
		if((keycode == 50)||(keycode == -1)){		
			yselect -= 15;
			menuselect --;
			if(yselect < 25){
				yselect = 100;
				menuselect = 6;
			}
		}
		//Xy ly hien thi khi nhan xuong trong main menu
		if((keycode == 56)||(keycode == -2)){
			yselect += 15;
			menuselect ++;
			if(yselect > 100){
				yselect = 25;
				menuselect = 1;
			}
		}
		if(keycode == -7)
			display.setCurrent(mainmenu);
		if(((keycode == 53)||(keycode == -5))&&(menuselect == 1)){					
			display.setCurrent(fishingplace);
		}
		repaint();
	}
}